<?php

require("utilities/utilsAppliTrombi.php") ;

if (!niveauOK(1)) return ;

connect() ;
$requete = "SELECT Eleve.*, COUNT(Rush.id) AS nr, MAX(Rush.qualite) AS mq FROM Eleve LEFT JOIN Rush ON Rush.eleve = Eleve.id GROUP BY Eleve.id ORDER BY RAND() ;" ;
$result = executerRequete($requete, $_GLOBALS['debug']) ;

?>
<?php
echo $f[0] ;
?>
<center>
<table style="border-style:none;width:100%;">
<tr>
<?php
$nombre = 0 ;
$liste = 0 ;
while ($row = mysql_fetch_assoc($result))
{
   if (intval($row['nr']) > 0) continue ;
   $nombre = $nombre+1 ;

   if ($nombre % 15 == 1)
   {
?>
</tr>
<tr>
<td colspan="10"><center><h1>Liste <?= ++$liste ;?></h1></center></td>
</tr>
<tr>
<?php
}
?>

<td style="height:200px;">
<center>
<?php

$f = file("https://www.frankiz.net/tol/apv/".$row["login"]) ;
?>
<img src="https://www.frankiz.net/<?= $f[0] ?>" height="200"/>
<br/>
<?= $row['prenom']." ".$row['nom'] ?>
<br/>
<br/>
<br/>
</center>
</td>
<?php
if ($nombre % 3 == 0) echo "</tr><tr>".PHP_EOL ;
//break;
}
?>
</tr>
</table>
</center>
<?php

mysql_close() ;

?>
